#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> pii;
// prority_queue<int, vecotr<int>, greater<int>> pq;

void solve() {
    int n, m;
    cin >> n >> m;
    vector<string> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    string s = "vika";
    int t = 0;
    for(int i = 0; i < m; i++) {
        for(int j = 0; j < n; j++) {
            if(a[j][i] == s[t]) {
                t++;
                break;
            }
        }
        if(t == 4) break;
    }
    if(t == 4) {
        cout << "YES\n";
    }else{
        cout << "NO\n";
    }
}

signed main() {
    int t; cin >> t;
    while(t--) solve();
    return 0;
}